package com.xrkj.b2c.service.impl.sys;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.xrkj.b2c.dao.sys.SysAdminMapper;
import com.xrkj.b2c.exception.DataAccessException;
import com.xrkj.b2c.model.sys.SysAdmin;
import com.xrkj.b2c.service.sys.SysAdminService;

/**
 * 
 * <B>系统名称：</B><BR>
 * <B>模块名称：</B><BR>
 * <B>中文类名：</B>系统管理员服务类<BR>
 * <B>概要说明：</B><BR>
 * 
 * @author 赵子靖
 * @since 2018年07月15日
 */
@Service
public class SysAdminServiceImpl implements SysAdminService {
    @Autowired
    private SysAdminMapper sysAdminDao;


    @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = DataAccessException.class)
    public int deleteByPrimaryKey(String id) {
        return sysAdminDao.deleteByPrimaryKey(id);
    }

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = DataAccessException.class)
    public int insert(SysAdmin record) {
        return sysAdminDao.insert(record);
    }

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = DataAccessException.class)
    public int insertSelective(SysAdmin record) {
        return sysAdminDao.insertSelective(record);
    }

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = DataAccessException.class)
    public SysAdmin selectByPrimaryKey(String id) {
        return sysAdminDao.selectByPrimaryKey(id);
    }

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = DataAccessException.class)
    public int updateByPrimaryKeySelective(SysAdmin record) {
        return sysAdminDao.updateByPrimaryKeySelective(record);
    }

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = DataAccessException.class)
    public int updateByPrimaryKey(SysAdmin record) {
        return sysAdminDao.updateByPrimaryKey(record);
    }

    /**
     * 
     * <B>方法名称：</B>根据用户名和密码获取信息<BR>
     * <B>概要说明：</B><BR>
     * 
     * @see com.xrkj.b2c.service.sys.SysAdminService#findSysAdminByLoginNameAndPwd(java.util.Map)
     */
    @Transactional(readOnly = true, propagation = Propagation.REQUIRED)
    public SysAdmin findAdminByAccountAndPwd(Map<String, Object> ret) {
        return sysAdminDao.findAdminByAccountAndPwd(ret);
    }

    /**
     * 
     * <B>方法名称：</B>获取列表<BR>
     * <B>概要说明：</B><BR>
     * 
     * @author perry
     * @since 2017年11月9日
     * @param paramter
     * @return
     */
    public Integer findAdminTotal(Map<String, Object> paramter) {
        return sysAdminDao.findAdminTotal(paramter);
    }

    /**
     * 
     * <B>方法名称：</B>获取记录数<BR>
     * <B>概要说明：</B><BR>
     * 
     * @author perry
     * @since 2017年11月9日
     * @param paramter
     * @return
     */
    public List<SysAdmin> findAdminList(Map<String, Object> paramter) {
        return sysAdminDao.findAdminList(paramter);
    }

    @Override
    public List<String> findAdminLikeName(String nicheng) {
        return sysAdminDao.findAdminLikeName(nicheng);
    }

}
